{% extends 'learn_app/base.html' %}
{% block header %}
Topic:{{topic}}&nbsp&nbsp
{% if request.user != topic.owner %}
作者：{{topic.owner}}
{% endif %}
{% endblock %}

{% block content %}
Entries:
{% if request.user == topic.owner %}
<a href="{% url 'learn_app:new_entry' topic.id %}"><br>添加新目录</a>
{% endif %}
{% for entry in entries %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3>
                创建时间:{{entry.date_added|date:'Y m-d,H:i'}}<br>
                最后修改时间:{{entry.last_modified|date:'Y m-d,H:i'}}<br>
                {% if request.user == topic.owner %}
                <small>
                    <a href="{% url 'learn_app:edit_entry' entry.id %}">修改目录</a>
                    <a href="{% url 'learn_app:del_entry' entry.id %}">删除条目</a>
                </small>
                {% endif %}
            </h3>
        </div>
        <div class="panel-body panel-bordered">
            {{entry.text|linebreaks}}
        </div>
    </div>
{% empty %}
<br>•They are no entries for this topic yet.
{% endfor %}
{% endblock %}